In recent years, flash memories having high cost-performances have been widely used as nonvolatile memories.
A flash memory is divided into a plurality of storage blocks, and writing of data per storage unit (for example, per record) in the storage blocks and erasure of data per storage block are possible, but if an instantaneous power failure occurs, abnormal termination of the writing or erasure of data occurs and there is a risk that data loss may be caused.
Thus, in flash memories, old data are erased after new data are written. In an example of control of such a flash memory, when a storage block to be written is to be changed, as flag information indicating a state of each storage block, management information, such as: “update started” and “update finished” flags storing a start and a finish of the change processing for an old storage block; an “erasure finished” flag storing that erasure has finished for a storage block to be subjected to erasure; and the like, is stored and based on the management information, updating, writing, erasure, or the like for a memory is performed (for example, see Patent Literature 1).